<%@ page import="java.sql.*" %>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*" %>
<%
//activate old session for use  
HttpSession currentsession = request.getSession(true);
if (currentsession == null) {
%>
	<div id="loginform">
	<form>
	You are currently browsing as anonymous guest.<br>
	Please <a href = "#" onClick="validate('display_login','loginform','html');">Login</a> to view user functions.
	</form>
	</div>	
<%
} else {
	if (currentsession.getAttribute("userid")==null) {
		%>
		<div id="loginform">
		<form>
		You are currently browsing as anonymous guest.<br>
		Please <a href = "#" onClick="validate('display_login','loginform','html');">Login</a> to view user functions.
		</form>
		</div>		
		<%
	} else {
%>
	<div id="loginform">
	You are logged in.<br>
	User ID: <%= currentsession.getAttribute("userid")%><br>
	Name:  <%= currentsession.getAttribute("name")%><br>
	<a href = "#" onClick="validate('logout','loginform','html');">Logout</a>?<br>
	</div>
<% 
	}
}
%>
